home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / sysklogd.postinst < prev    next >
Encoding:
Text File  |  2007-03-08  |  1.7 KB  |  91 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. if [ "$1" = "configure" ]
  6. then
  7.     case $2 in
  8.     1.2-*)
  9. cat<<EOT
  10. The default behaviour of syslogd has altered from 1.2 to 1.3.  By default
  11. *no* messages from the UDP port are accepted.
  12.  
  13. Read the documentation in /usr/share/doc/sysklogd carefully.  Some important
  14. things have been changed!
  15.  
  16. Press [Enter] to continue
  17. EOT
  18.     read xyz
  19.     ;;
  20.   esac
  21. fi
  22.  
  23. if [ "$1" = "configure" ]
  24. then
  25.  
  26.     # Prepare for takeover of the host
  27.     if [ -z "$2" ]
  28.     then
  29.     if [ ! -e /var/log/news ] \
  30.         && grep -q '^[^#].*/var/log/news/' /etc/syslog.conf \
  31.         && grep -q ^news: /etc/passwd \
  32.         && grep -q ^news: /etc/group 
  33.     then
  34.         mkdir /var/log/news
  35.         chmod 2755 /var/log/news
  36.         chown news:news /var/log/news
  37.     fi
  38.  
  39.     # Create logfiles with correct file modes
  40.     if [ -z "$2" ]
  41.     then
  42.         for LOG in `syslogd-listfiles --all`
  43.         do
  44.           if [ ! -f $LOG ]
  45.           then
  46.           touch $LOG
  47.           fi
  48.           chown root:adm $LOG
  49.           chmod 640 $LOG
  50.         done
  51.     fi
  52.     fi
  53.  
  54.     if [ -f /etc/init.d/sysklogd -a -n "$2" ]
  55.     then
  56.     set +e
  57.     if [ -x /usr/sbin/invoke-rc.d ]
  58.     then
  59.         invoke-rc.d sysklogd stop
  60.     else
  61.         sh /etc/init.d/sysklogd stop
  62.     fi
  63.     set -e
  64.     fi
  65.  
  66.     update-rc.d sysklogd multiuser 10 90 >/dev/null
  67.  
  68.     # Remove shutdown and reboot links; this init script does not need them.
  69.     if dpkg --compare-versions "$2" lt "1.4.1-18ubuntu2"; then
  70.     rm -f /etc/rc0.d/K90sysklogd /etc/rc6.d/K90sysklogd
  71.     fi
  72.  
  73.     adduser --system --group --no-create-home --quiet syslog
  74.  
  75.     # restarting daemon
  76.     #
  77.     if [ -f /etc/init.d/sysklogd ]
  78.     then
  79.     set +e
  80.     if [ -x /usr/sbin/invoke-rc.d ]
  81.     then
  82.         invoke-rc.d sysklogd start
  83.     else
  84.         sh /etc/init.d/sysklogd start
  85.     fi
  86.     set -e
  87.     fi
  88. fi
  89.  
  90. exit 0
  91.